<!--黑名单企业详细-->
<template>
  <div class="container">
    <topTitle
      :titleText="titleText"
      :back="back"
      @gobackTriser="goBack"
    ></topTitle>
    <div class="mainCon">
      <table cellspacing="0" cellpadding="0" class="detailTable">
        <tr>
          <td class="title">企业名称：</td>
          <td>{{ companyInfo.name || '--' }}</td>
          <td class="title">统一社会信用代码：</td>
          <td>{{ companyInfo.uscc || '--' }}</td>
        </tr>
        <tr>
          <td class="title">法人姓名：</td>
          <td>{{ companyInfo.boss || '--' }}</td>
          <td class="title">法人身份证号：</td>
          <td>{{ companyInfo.bossIdCard || '--' }}</td>
        </tr>
        <tr>
          <td class="title">注册地址：</td>
          <td colspan="3">{{ companyInfo.address || '--' }}</td>
        </tr>
        <tr>
          <td class="title">列入名单事由：</td>
          <td colspan="3">{{ companyInfo.reason || '--' }}</td>
        </tr>
        <tr>
          <td class="title">涉及金额：</td>
          <td>{{ companyInfo.arrearage || '--' }}</td>
          <td class="title">列入日期：</td>
          <td>{{ format(companyInfo.effectiveStartDate) }}</td>
        </tr>
        <tr>
          <td class="title">认定部门：</td>
          <td>{{ companyInfo.thatDepartment || '--' }}</td>
          <td class="title">文书号：</td>
          <td>{{ companyInfo.punishNumber || '--' }}</td>
        </tr>
        <tr>
          <td class="title">退出原因：</td>
          <td colspan="3">{{ companyInfo.outReason || '--' }}</td>
          <!-- <td class="title">退出时间：</td>
                    <td>{{format(companyInfo.effectiveEndDate)}}</td> -->
        </tr>
        <tr>
          <td class="title">退出时间：</td>
          <td>{{ format(companyInfo.effectiveEndDate) }}</td>
          <td class="title">数据来源：</td>
          <td>{{ companyInfo.dataSource || '--' }}</td>
        </tr>
      </table>
    </div>
  </div>
</template>

<script>
import moment from 'moment'
export default {
  name: 'companyBlackDetail',
  components: {},
  data() {
    return {
      titleText: '黑名单详情',
      back: true,
      companyInfo: '',
      companyId: '',
    }
  },
  created() {
    this.companyId = this.$route.query.companyId
    this.getInfo()
  },
  methods: {
    getInfo() {
      this.axios({
        method: 'post',
        url: 'api-c/company/expand/findBlackCompanyById',
        data: {
          companyId: this.companyId,
        },
      })
        .then(
          (response) => {
            if (!response.data.hasError) {
              this.companyInfo = response.data
            } else {
              this.$message({
                type: 'error',
                message: '数据获取失败',
              })
            }
          },
          (response) => {}
        )
        .catch((error) => {})
    },
    goBack() {
      this.$router.push('/home/companyProjectManage/companyBlackList')
      this.$store.commit('GOBACK_NAME', {
        oldUrl: '/home/companyProjectManage/companyBlackList',
        newUrl: this.$router.currentRoute.fullPath,
      })
    },
    format(date) {
      return moment(date).format('YYYY.MM.DD')
    },
  },
}
</script>

<style scoped>
.mainCon {
  padding-left: 24px;
  padding-right: 24px;
  height: calc(100% - 67px);
}
</style>
